HADOOP-19964. Restore TimedOutTestsListener thread dumps on test timeout. - #8682
HADOOP-19964. Restore TimedOutTestsListener thread dumps on test timeout.#8682joseluisll wants to merge 1 commit into
Conversation
|
Cross-reference: this pairs with #8659 (HDFS-17957), which sets a default |
cb2e328 to
0d7c41b
Compare
|
The AI-generated PR description is too verbose |
0d7c41b to
d2d6f0b
Compare
|
🎊 +1 overall
This message was automatically generated. |
|
The Maven community has accepted SUREFIRE-1639, and it will be included in the 3.6.0-M2. Let me convert this to a draft first and wait for the release. |
It has just been released as part of version 3.6.0 here: https://github.com/apache/maven-surefire/releases/tag/surefire-3.6.0 |
|
@joseluisll, but you didn't do the surefire plugin update? |
|
we may need to wait for 3.6.1 because there is a bug apache/maven-surefire#3453 |
Nope, will do the plugin update in the POM and check for impact. It seems that the new listener property requires adding a test-scope hadoop-common test-jar dependency for these two modules: hadoop-yarn-services-core, hadoop-yarn-applications-catalog-webapp . Will do a validation for all the modules as well, not only those two. |
GenericTestUtils.waitFor dumps all threads with deadlock analysis to stderr at the moment the wait expires. Its TimeoutException message drops from ~16KB to one line. Sample failure report: 18,223 -> 1,642 bytes. TimedOutTestsListener implements TestExecutionListener, and Surefire moves to 3.6.0, which accepts platform listeners in the `listener` provider property (SUREFIRE-1639). The property the eight poms already carry now registers it, restoring dumps for @timeout failures across hadoop-common, KMS, HDFS, HTTPFS and all of YARN and MapReduce. hadoop-yarn-services-core and hadoop-yarn-applications-catalog-webapp inherit that property but depended on hadoop-common's main jar only; both now take its test-jar in test scope. Without it Surefire 3.6.0 cannot resolve the listener and the fork dies before any test runs. - -Dhadoop.test.timedout.dump=false disables dumps. - -Dhadoop.test.timedout.dump.limit (default 5) caps them per JVM, with one elision notice. Both entry points share the budget. - The exception records "Thread dump printed to stderr." only when a dump was printed. - The two checkstyle violations the 2012 test file carried are fixed. Not covered: Surefire's fork kill at forkedProcessTimeoutInSeconds (Shutdown.KILL -> Runtime.halt()). HADOOP-19950 captures those reports. Release note: Surefire moves to 3.6.0, and waitFor's TimeoutException message no longer carries the thread dump. Tests: TestTimedOutTestsListener and TestGenericTestUtils pass (15 tests). A hanging @timeout(3) test produces exactly one labelled dump through the listener. Full-tree build passes on 119 modules, and the listener resolves on the test classpath of all 36 modules carrying the property. Contains content generated by Claude Code. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RrG4oLaFUcjSuv9Q5zeaZe
d2d6f0b to
98efd0d
Compare
|
💔 -1 overall
This message was automatically generated. |
|
@pan3793: It seems that the surefire plugin update to version 3.6 breaks the tests (the stack suddenly prefers IPv6 instead of IPv4) . ¿Should I investigate the update of the maven-surefire-plugin in this PR as well? ¿or shall I create a specific JIRA/PR to update maven-surefire-plugin to version 3.6? |
Description of PR
JIRA: HADOOP-19964
GenericTestUtils.waitForbuilt a 16 KB thread dump into everyTimeoutExceptionmessage, at 650 call sites. It now dumps to stderr themoment the wait expires, while the threads are still hung, and the message
drops to one line. Sample failure report: 18,223 -> 1,642 bytes.
TimedOutTestsListenerhas registered nothing since HADOOP-19415 Part 4 movedSurefire onto the JUnit Platform provider, which ignores the
listenerproperty. It now implements
TestExecutionListener, so the property the eightpoms already carry binds to it once the provider accepts platform listeners
(SUREFIRE-1639, apache/maven-surefire#3438). Dormant until then. No pom is
touched.
-Dhadoop.test.timedout.dump=falsedisables dumps.-Dhadoop.test.timedout.dump.limit(default 5) caps them per JVM. Both entrypoints share the budget.
Not covered: a fork killed at
forkedProcessTimeoutInSeconds(Shutdown.KILL->
Runtime.halt()). HADOOP-19950 captures those.Release note:
waitFor'sTimeoutExceptionmessage no longer carries thethread dump. Nothing in the Hadoop tree asserted on it; downstream code that
does will need adjusting.
Contains content generated by Claude Code.
How was this patch tested?
mvn test -pl hadoop-common-project/hadoop-common -Dtest='TestTimedOutTestsListener,TestGenericTestUtils'— 15 tests, all pass.
TestTimedOutTestsListenercovers deadlock detection, timeout-failuredetection, the off switch, the dump limit and its elision notice,
dumpForTimeout's return value, andwaitFor's exact message with a dumpprinted, with dumps off, and with the budget spent — driving the real
waitFor. Checkstyle clean on both listener files; the two violations the 2012test file carried are fixed.
For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryupdated — N/AAI Tooling
https://www.apache.org/legal/generative-tooling.html